package com.sc.nft.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.sc.nft.entity.DaoEcologyPoints;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.sc.nft.entity.vo.AdminDaoEcologyPointsVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;

/**
 * DAO-生态燃料余额表(sc_dao_ecology_points)数据Mapper
 *
 * @author Sun
 * @since 2023-12-06 18:45:26
 * @description 由 Mybatisplus Code Generator 创建
*/
@Mapper
public interface DaoEcologyPointsMapper extends BaseMapper<DaoEcologyPoints> {

    /**
     * 减少余额
     * @param daoId
     * @param transferAmount
     * @return
     */
    Boolean subAmount(@Param("daoId") Long daoId, @Param("transferAmount")BigDecimal transferAmount);

    /**
     * 增加可用余额 减去冻结余额
     * @param daoId
     * @param amount
     * @return
     */
    Boolean addAmountAndSubFrozenAmount(@Param("daoId") Long daoId, @Param("amount") BigDecimal amount);

    /**
     * 分页获取DAO燃料列表
     * @param page
     * @param daoName
     * @return
     */
    Page<AdminDaoEcologyPointsVO> getPage( Page page,@Param("daoName") String daoName);
}
